#include <REGX52.H>
#include <INTRINS.H>

sbit LED=P2^0;

void Delay(unsigned int t)
{
	while(t--);
}

void main()
{
    while(1)
    {
		unsigned char i, j;
        for(i = 0; i < 100; ++i)
		{
			for(j = 0; j < 20; ++j)
			{
				LED = 0;
				Delay(i);
				LED = 1;
				Delay(100 - i);
			}
		}
		for(i = 0; i < 100; ++i)
		{
			for(j = 0; j < 20; ++j)
			{
				LED = 1;
				Delay(i);
				LED = 0;
				Delay(100 - i);
			}
		}
    }
}